/**
 * Created by lizhenya on 2018/5/19.
 */

function openBar() {
    toolbar.hasClass("open") || (toolbar.addClass("open"),
        $("#shop_cart .lazyload").removeClass("hidden").find("img").trigger("appear"),
        $(".global_toolbar").removeClass("default"),
        $(".toolbar_btn").css({
            top: "50%",
            marginTop: -$(".toolbar_btn").height() / 2
        })),
        $(".global_toolbar").removeClass("opacity"),
        $(".toolbar_btn").removeClass("default")
}
function closeBar() {
    $(".toolbar_btn a").removeClass("current"),
        toolbar.removeClass("open"),
        $(".toolbar_btn").removeClass("default")
}




var toolbar = $(".global_toolbar");
$(function() {
    $("#wap_cartbtn_display").addClass("none");
    var t = $(window).height();
    $(window).width();
    setTimeout(function() {
        BindDataTableAll()
    }, 5e3),
        $("body").click(function(t) {
            toolbar.hasClass("open") && closeBar()
        }),
        toolbar.click(function(t) {
            t.stopPropagation()
        }),
        
      
        $(".r_item dd a").click(function() {
            $("#choosen_tips").show(),
                $(".product_series .picbox font").hide(),
                $(this).parents(".fixed_sidebar").hide()
        });
    var i = t - $(".fixed_sidebar h1").outerHeight(!0);
   
        $("body").click(function() {
            $("#pc_sidebar li").removeClass("current")
        }),
        $("#pc_sidebar,.item_layer").click(function(t) {
            t.stopPropagation()
        }),
        $(".toolbar_btn a:not('.bar_forum')").bind("click", function(t) {
            t.stopPropagation();
            var e = $(this).attr("data-id")
                , i = $("." + e);
            $(this).hasClass("current") ? $(this).removeClass("current") : $(this).addClass("current").siblings("a").removeClass("current"),
                i.hasClass("open") ? closeBar() : openBar()
        }),
        $(".wap_cartbtn").bind("click", function(t) {
            t.stopPropagation(),
                autoShopcartH(),
            $(this).hasClass("disable") || ($(".global_toolbar").hasClass("open") ? closeBar() : openBar())
        }),
        $(".js_column h4 a").click(function() {
            closeBar()
        })
});

function closeContact() {
    "ar-sa" == $("#gLanguageCurrent").val() ? ($(".contact_btn").removeClass("open"),
        $(".contact_btn b").hide(),
        $(".contact_layer").animate({
            left: -250
        })) : ($(".contact_layer").animate({
        right: -250
    }, 300),
        $(".contact_btn").removeClass("open"),
        $(".contact_btn b").hide())
}
function closeCompare() {
    var e = $("#compare_column");
    winW > 768 ? e.animate({
        right: -335
    }, 300) : e.animate({
        right: "-100%"
    }, 300),
        $(".compare_btn b").hide(),
        $(".compare_btn").removeClass("open")
}
function closeCart() {
    0 == $(".shopping_all").length ? winW > 768 ? $("#shopping_cart").animate({
        right: -335
    }, 300) : $("#shopping_cart").animate({
        right: "-100%"
    }, 300) : winW > 980 ? $("#shopping_cart").animate({
        right: -335
    }, 300) : $("#shopping_cart").animate({
        right: "-100%"
    }, 300),
        $(".shopping_cart").removeClass("bg"),
        $(".shopping_btn b").hide(),
        $(".shopping_btn").removeClass("open")
}

var winW = $(window).width()
    , hwa_DisablHwa = "" != document.domain || "1" == $("#hidDisableHwa").val() || navigator.userAgent.match(/AppleWebKit.*Mobile.*/) || navigator.userAgent.indexOf("iPad") > -1;
!hwa_DisablHwa && checkDomain(),

    $(function() {
        get_FeedBack_Url()
    })
